<div class="collapse navbar-collapse" id="sidebarCollapse">
    <!-- Navigation -->
    <ul class="navbar-nav">
        <li class="nav-item">
            <a class="nav-link active" href="/">
                <i class="fe fe-home"></i> 文章系统后台(动态生成)
            </a>
        </li>


        @foreach(admin_menus() as $topmenus)
            @if(auth()->user()->hasAnyPermission($topmenus['permission']))
            <li class="nav-item">
                <a class="nav-link" href="{{route('content.home.content',1)}}" target="_blank" data-toggle="collapse"
                   role="button" aria-expanded="false" aria-controls="sidebarPages">
                    <i class="{{$topmenus['icon']}}"></i> {{$topmenus['name']}}
                </a>
                <div class="collapse show" id="sidebarPages">
                    <ul class="nav nav-sm flex-column">
                        @foreach($topmenus['menus'] as $menu)
                            @can($menu['permission'])
                            <li class="nav-item">
                                <a href="{{$menu['route']}}" class="nav-link ">
                                    {{$menu['name']}}
                                </a>
                            </li>
                            @endcan
                        @endforeach
                    </ul>
                </div>
            </li>
            @endif
        @endforeach


        <li class="nav-item d-md-none">
            <a class="nav-link" href="#sidebarModalActivity" data-toggle="modal">
                <span class="fe fe-bell"></span> Notifications
            </a>
        </li>
    </ul>

    <!-- Divider -->
    <hr class="my-3">


    <!-- Navigation -->
    <ul class="navbar-nav mb-md-3">
        <li class="nav-item">
            <a class="nav-link " href="changelog.html">
                <i class="fe fe-git-branch"></i> 道行 <span class="badge badge-primary ml-auto">v1.2.0</span>
            </a>
        </li>
    </ul>
    <!-- User (md) -->
    <div class="navbar-user mt-auto d-none d-md-flex">
        <!-- Icon -->
        <a href="#sidebarModalActivity" class="text-muted" data-toggle="modal">
              <span class="icon">
                <i class="fe fe-bell"></i>
              </span>
        </a>
        <!-- Dropup -->
        <div class="dropup">

            <!-- Toggle -->
            <a href="#!" id="sidebarIconCopy" class="dropdown-toggle" role="button" data-toggle="dropdown"
               aria-haspopup="true" aria-expanded="false">
                <div class="avatar avatar-sm avatar-online">
                    <img src="{{auth()->user()->icon??''}}"
                         class="avatar-img rounded-circle" alt="...">
                </div>
            </a>

            <!-- Menu -->
            <div class="dropdown-menu" aria-labelledby="sidebarIconCopy">
                <a href="profile-posts.html" class="dropdown-item">Profile</a>
                <a href="settings.html" class="dropdown-item">Settings</a>
                <hr class="dropdown-divider">
                <a href="sign-in.html" class="dropdown-item">Logout</a>
            </div>

        </div>
        <!-- Icon -->
        <a href="#sidebarModalSearch" class="text-muted" data-toggle="modal">
              <span class="icon">
                <i class="fe fe-search"></i>
              </span>
        </a>
    </div>
</div>
